home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: ncrgw2.ncr.com!ncrhub6!daynews!falcon!news
- From: Dick Menninger <Dick.Menninger@DaytonOH.ATTGIS.COM>
- Subject: Re: Difficulty hiring people with C++ experience.
- X-Nntp-Posting-Host: 149.25.99.44
- Message-ID: <DL1Dp5.H9z@falcon.daytonoh.attgis.com>
- Sender: news@falcon.daytonoh.attgis.com (News administrative Login)
- Reply-To: Dick.Menninger@DaytonOH.ATTGIS.COM (mennid)
- Organization: AT&T Global Information Solutions
- X-Newsreader: DiscussIT 2.5.1.3 for MS Windows [AT&T Software Products Division]
- References: <ALUN.CHAMPION.96Jan10160055@g7240065.bridge.bst.bls.com>
- Date: Thu, 11 Jan 1996 21:43:53 GMT
-
-
- > ==========Alun Champion, 1/10/96==========
- >
- > In article <4d12p3$26lq@news.doit.wisc.edu>
- > keiter@hp-171.cae.wisc.edu (Eric Richard Keiter) writes:
- >
- > : (Tom Donaldson) writes:
- > :: When asked about
- > :: "programming by contract", the response is "Huh?" The
-
- [stuff deleted]
-
- > : and what is programming by contract? it sounds like an
- > obvious question
- > : -- is the answer not obvious?
-
- > The contract between the user and its supplier is the set of
- > requests that
- > a user can make of that supplier. Programming by contract is the focus
- > of ensuring the supplier fulfils its contracts. Some aspects
- of the user
- > contract is enforced by the compiler like making methods private
- > or protected
- > but the ability to grant access for particular classes is not
- > possible at the
- > moment, so some reliance is on the user of the class to not
- > break its contract
- > with the supplier.
- > In a multi-threaded environment its very hard to guarentee the
- > contract between
- > user and supplier because the guarentee of the supplier can be
- broken by
- > another thread i.e. values changed etc.. In these situations
- you lock the
- > supplier so it can guarentee the contract for the period of that lock.
-
- Well this might not have fully communicated the complete
- concept. A contract provides the rules, invariants, rights
- and responsibilities of all parties involved. It applies to
- functional interfaces that return stuff (e.g., the caller is
- responsible for destroying the stuff when done with it--
- is a contract part), as well. The idea of contracts is to make
- all of the semantic properties and expectations more
- explicit and visible. When a language includes mechanisms
- for specifying some of it, then more can be checked
- either at compile time or run-time. A supplier could do
- some of this with ASSERT macros or statements in the
- supplier code, though the form may be less clear.
- But the user side is generally problematic to auto-verify.
- Worse, most of the contractual details the users needs
- to know are often undocumented, as well. The more
- expensive bugs [bugs found late in testing and in released
- products] tend to be caused by poorly documented contracts
- or inconsistent contracts [it would be nice to have to state
- them in a way that most inconsistencies could be checked].
-
- So, contracts are one place where program specification,
- program verification, automatic compile and run-time checking,
- and proof of correctness are likely to converge for significant
- subsets of software development.
-
- Good Day
- Dick
- Dick.Menninger@DaytonOH.ATTGIS.COM
-
-